package com.pp.mariage.server.validator;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 
 * @author Pascal
 *
 */
public class ValidationService {

	public static boolean isValidEmail(String mail) {
		Pattern pattern = Pattern.compile("^.+@.+\\..+$");
		Matcher matcher = pattern.matcher(mail);
		return matcher.matches();
	}

	public static String manageNullValue(Object inputValue) {
		if (inputValue == null) {
			return "";
		}
		return inputValue.toString();
	}
}
